﻿using FrameworkCore.Models;

namespace FrameworkCore.Extensions
{
    public static class PaginatedDataExtensions
    {
        public static PageResult<T> ToPageList<T>(this PaginatedData<T> paginatedData) where T : class
        {
            return new PageResult<T>
            {
                Success = true,
                Data = paginatedData.Data,
                Total = paginatedData.Total,
                Current = paginatedData.Current,
                PageSize = paginatedData.PageSize,
                TotalPages = paginatedData.TotalPages,
            };
        }
    }
}
